﻿///***************************************************************
/// 시  스  템 : Updms.Cfg.Dac
/// 단위시스템 : CFG
/// 계      층 : Data Access Layer
/// 프로그램명 : Cfg_Dac_UPDMS_CFG_SETTING
/// 파  일  명 : Cfg_Dac_UPDMS_CFG_SETTING.cs
/// 설      명 : 설정관리
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2008-08-06 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;


namespace Updms.Cfg.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Cfg_Dac_UPDMS_CFG_SETTING : Base.AppFramework.DacBase
	{
		public Cfg_Dac_UPDMS_CFG_SETTING()
		{
		}		

		#region NT [SelectProcess]
		
		[AutoComplete]
		public DataSet SelectProcess()
		{
			string strSql = "usp_UPDMS_CFG_SETTING_Select";			

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_CFG_SETTING", ds, null, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [GetValueByFieldNm]
		
		/// <summary>
		/// 설정관리에서 특정필드값을 가져온다.
		/// </summary>
		/// <param name="ls_field_nm"></param>
		/// <returns></returns>
		[AutoComplete]
		public string GetValueByFieldNm(string ls_field_nm)
		{
			string strSql = "usp_UPDMS_CFG_SETTING_Select";

			DataSet ds = new DataSet();
			_agent.Fill(strSql, "UPDMS_CFG_SETTING", ds, null, CommandType.StoredProcedure);

			return ds.Tables["UPDMS_CFG_SETTING"].Rows[0][ls_field_nm].ToString().Trim();
		}

		#endregion
		
		

		#region RT [Insert]
		
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_CFG_SETTING_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Update]
		
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_CFG_SETTING_Update";
		
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

	}
}
